package gestionTransportObjetsGenerated;

/**
 * Enum definition : Voisin
 *
 * @author OpenORB Compiler
*/
public final class Voisin implements org.omg.CORBA.portable.IDLEntity
{
    /**
     * Enum member On value 
     */
    public static final int _On = 0;

    /**
     * Enum member On
     */
    public static final Voisin On = new Voisin(_On);

    /**
     * Enum member Near value 
     */
    public static final int _Near = 1;

    /**
     * Enum member Near
     */
    public static final Voisin Near = new Voisin(_Near);

    /**
     * Enum member Off value 
     */
    public static final int _Off = 2;

    /**
     * Enum member Off
     */
    public static final Voisin Off = new Voisin(_Off);

    /**
     * Internal member value 
     */
    private final int _Voisin_value;

    /**
     * Private constructor
     * @param  the enum value for this new member
     */
    private Voisin( final int value )
    {
        _Voisin_value = value;
    }

    /**
     * Maintains singleton property for serialized enums.
     * Issue 4271: IDL/Java issue, Mapping for IDL enum.
     */
    public java.lang.Object readResolve() throws java.io.ObjectStreamException
    {
        return from_int( value() );
    }

    /**
     * Return the internal member value
     * @return the member value
     */
    public int value()
    {
        return _Voisin_value;
    }

    /**
     * Return a enum member from its value
     * @param  an enum value
     * @return an enum member
         */
    public static Voisin from_int(int value)
    {
        switch (value)
        {
        case 0 :
            return On;
        case 1 :
            return Near;
        case 2 :
            return Off;
        }
        throw new org.omg.CORBA.BAD_OPERATION();
    }

    /**
     * Return a string representation
     * @return a string representation of the enumeration
     */
    public java.lang.String toString()
    {
        switch (_Voisin_value)
        {
        case 0 :
            return "On";
        case 1 :
            return "Near";
        case 2 :
            return "Off";
        }
        throw new org.omg.CORBA.BAD_OPERATION();
    }

}
